package com.kgdev.cweb.entities.pub;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import com.kgdev.cweb.entities.ManagedEntity;
import com.kgdev.cweb.entities.sys.Icon;


/**
 * The persistent class for the pub_choc_clr_plbd database table.
 * 
 */
@Entity
@NamedQueries(value = {
		@NamedQuery(name = "ChocolateColorBody.findAll", query = "select c from ChocolateColorBody c") })
@Table(name="pub_choc_clr_plbd")
public class ChocolateColorBody implements Serializable, ManagedEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="body_color", unique=true, nullable=false, length=45)
	private String chocolateColor;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((chocolateColor == null) ? 0 : chocolateColor.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChocolateColorBody other = (ChocolateColorBody) obj;
		if (chocolateColor == null) {
			if (other.chocolateColor != null)
				return false;
		} else if (!chocolateColor.equals(other.chocolateColor))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ChocolateColorBody [chocolateColor=" + chocolateColor
				+ ", isAvailable=" + isAvailable + "]";
	}

	@ManyToOne
	@JoinColumn(name="icon_id")
	private Icon icon;

	public Icon getIcon() {
		return icon;
	}

	public void setIcon(Icon icon) {
		this.icon = icon;
	}
	
	@Column(name="is_available", nullable=false)
	private Boolean isAvailable;

    public ChocolateColorBody() {
    }

	public String getChocolateColor() {
		return this.chocolateColor;
	}

	public void setBodyColor(String bodyColor) {
		this.chocolateColor = bodyColor;
	}

	public Boolean getIsAvailable() {
		return this.isAvailable;
	}

	public void setIsAvailable(Boolean isAvailable) {
		this.isAvailable = isAvailable;
	}

}